-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(database): add DragonflyDB operator and cluster resources #2808
Conversation
Quality Gate passedIssues Measures |
--- kubernetes/talos-flux/apps Kustomization: flux-system/apps-sync Kustomization: flux-system/apps-dragonfly-operator
+++ kubernetes/talos-flux/apps Kustomization: flux-system/apps-sync Kustomization: flux-system/apps-dragonfly-operator
@@ -0,0 +1,36 @@
+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+ labels:
+ kustomize.toolkit.fluxcd.io/name: apps-sync
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: apps-dragonfly-operator
+ namespace: flux-system
+spec:
+ commonMetadata:
+ labels:
+ app.kubernetes.io/component: dragonfly
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/name: dragonfly-operator
+ decryption:
+ provider: sops
+ secretRef:
+ name: sops-age
+ interval: 30m
+ path: ./kubernetes/talos-flux/apps/database/dragonfly/operator
+ postBuild:
+ substituteFrom:
+ - kind: ConfigMap
+ name: cluster-settings
+ - kind: Secret
+ name: cluster-secrets
+ prune: true
+ retryInterval: 1m
+ sourceRef:
+ kind: GitRepository
+ name: home-ops
+ targetNamespace: database
+ timeout: 5m
+ wait: true
+
--- kubernetes/talos-flux/apps Kustomization: flux-system/apps-sync Kustomization: flux-system/apps-dragonfly-cluster
+++ kubernetes/talos-flux/apps Kustomization: flux-system/apps-sync Kustomization: flux-system/apps-dragonfly-cluster
@@ -0,0 +1,38 @@
+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+ labels:
+ kustomize.toolkit.fluxcd.io/name: apps-sync
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: apps-dragonfly-cluster
+ namespace: flux-system
+spec:
+ commonMetadata:
+ labels:
+ app.kubernetes.io/component: dragonfly
+ app.kubernetes.io/instance: dragonfly-cluster
+ app.kubernetes.io/name: dragonfly-cluster
+ decryption:
+ provider: sops
+ secretRef:
+ name: sops-age
+ dependsOn:
+ - name: apps-dragonfly-operator
+ interval: 30m
+ path: ./kubernetes/talos-flux/apps/database/dragonfly/cluster
+ postBuild:
+ substituteFrom:
+ - kind: ConfigMap
+ name: cluster-settings
+ - kind: Secret
+ name: cluster-secrets
+ prune: true
+ retryInterval: 1m
+ sourceRef:
+ kind: GitRepository
+ name: home-ops
+ targetNamespace: database
+ timeout: 5m
+ wait: true
+
--- kubernetes/talos-flux/apps/database/dragonfly/cluster Kustomization: flux-system/apps-dragonfly-cluster Dragonfly: database/dragonfly
+++ kubernetes/talos-flux/apps/database/dragonfly/cluster Kustomization: flux-system/apps-dragonfly-cluster Dragonfly: database/dragonfly
@@ -0,0 +1,32 @@
+---
+apiVersion: dragonflydb.io/v1alpha1
+kind: Dragonfly
+metadata:
+ labels:
+ app.kubernetes.io/component: dragonfly
+ app.kubernetes.io/instance: dragonfly-cluster
+ app.kubernetes.io/name: dragonfly-cluster
+ kustomize.toolkit.fluxcd.io/name: apps-dragonfly-cluster
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: dragonfly
+ namespace: database
+spec:
+ args:
+ - --maxmemory=$(MAX_MEMORY)Mi
+ - --proactor_threads=2
+ - --cluster_mode=emulated
+ - --lock_on_hashtags
+ env:
+ - name: MAX_MEMORY
+ valueFrom:
+ resourceFieldRef:
+ divisor: 1Mi
+ resource: limits.memory
+ image: ghcr.io/dragonflydb/dragonfly:v1.16.1
+ replicas: 4
+ resources:
+ limits:
+ memory: 512Mi
+ requests:
+ cpu: 100m
+
--- kubernetes/talos-flux/apps/database/dragonfly/cluster Kustomization: flux-system/apps-dragonfly-cluster PodMonitor: database/dragonfly
+++ kubernetes/talos-flux/apps/database/dragonfly/cluster Kustomization: flux-system/apps-dragonfly-cluster PodMonitor: database/dragonfly
@@ -0,0 +1,21 @@
+---
+apiVersion: monitoring.coreos.com/v1
+kind: PodMonitor
+metadata:
+ labels:
+ app.kubernetes.io/component: dragonfly
+ app.kubernetes.io/instance: dragonfly-cluster
+ app.kubernetes.io/name: dragonfly-cluster
+ kustomize.toolkit.fluxcd.io/name: apps-dragonfly-cluster
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: dragonfly
+ namespace: database
+spec:
+ podMetricsEndpoints:
+ - port: admin
+ podTargetLabels:
+ - app
+ selector:
+ matchLabels:
+ app: dragonfly
+
--- kubernetes/talos-flux/apps/database/dragonfly/operator Kustomization: flux-system/apps-dragonfly-operator HelmRelease: database/dragonfly-operator
+++ kubernetes/talos-flux/apps/database/dragonfly/operator Kustomization: flux-system/apps-dragonfly-operator HelmRelease: database/dragonfly-operator
@@ -0,0 +1,112 @@
+---
+apiVersion: helm.toolkit.fluxcd.io/v2beta2
+kind: HelmRelease
+metadata:
+ labels:
+ app.kubernetes.io/component: dragonfly
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/name: dragonfly-operator
+ kustomize.toolkit.fluxcd.io/name: apps-dragonfly-operator
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: dragonfly-operator
+ namespace: database
+spec:
+ chart:
+ spec:
+ chart: app-template
+ sourceRef:
+ kind: HelmRepository
+ name: bjw-s-charts
+ namespace: flux-system
+ version: 3.1.0
+ install:
+ remediation:
+ retries: 3
+ interval: 30m
+ upgrade:
+ cleanupOnFail: true
+ remediation:
+ retries: 3
+ strategy: rollback
+ values:
+ controllers:
+ dragonfly-operator:
+ containers:
+ app:
+ args:
+ - --health-probe-bind-address=:8081
+ - --metrics-bind-address=:8080
+ command:
+ - /manager
+ image:
+ repository: ghcr.io/dragonflydb/operator
+ tag: v1.1.2@sha256:f0d76725950095ac65b36252e0042d339d1db9b181b1d068f4b6686ea93055e4
+ probes:
+ liveness:
+ custom: true
+ enabled: true
+ spec:
+ failureThreshold: 3
+ httpGet:
+ path: /healthz
+ port: 8081
+ initialDelaySeconds: 15
+ periodSeconds: 20
+ timeoutSeconds: 1
+ readiness:
+ custom: true
+ enabled: true
+ spec:
+ failureThreshold: 3
+ httpGet:
+ path: /readyz
+ port: 8081
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ timeoutSeconds: 1
+ resources:
+ limits:
+ memory: 128Mi
+ requests:
+ cpu: 10m
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ readOnlyRootFilesystem: true
+ pod:
+ securityContext:
+ runAsGroup: 65534
+ runAsNonRoot: true
+ runAsUser: 65534
+ topologySpreadConstraints:
+ - labelSelector:
+ matchLabels:
+ app.kubernetes.io/name: dragonfly-operator
+ maxSkew: 1
+ topologyKey: kubernetes.io/hostname
+ whenUnsatisfiable: DoNotSchedule
+ replicas: 1
+ strategy: RollingUpdate
+ service:
+ app:
+ controller: dragonfly-operator
+ ports:
+ http:
+ port: 8081
+ metrics:
+ port: 8080
+ serviceAccount:
+ create: true
+ name: dragonfly-operator
+ serviceMonitor:
+ app:
+ endpoints:
+ - interval: 1m
+ path: /metrics
+ port: metrics
+ scheme: http
+ scrapeTimeout: 10s
+ serviceName: dragonfly-operator
+
--- kubernetes/talos-flux/apps/database/dragonfly/operator Kustomization: flux-system/apps-dragonfly-operator ClusterRole: flux-system/dragonfly-operator
+++ kubernetes/talos-flux/apps/database/dragonfly/operator Kustomization: flux-system/apps-dragonfly-operator ClusterRole: flux-system/dragonfly-operator
@@ -0,0 +1,83 @@
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRole
+metadata:
+ labels:
+ app.kubernetes.io/component: dragonfly
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/name: dragonfly-operator
+ kustomize.toolkit.fluxcd.io/name: apps-dragonfly-operator
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: dragonfly-operator
+rules:
+- apiGroups:
+ - coordination.k8s.io
+ resources:
+ - leases
+ verbs:
+ - get
+ - list
+ - watch
+ - create
+ - update
+ - patch
+ - delete
+- apiGroups:
+ - ''
+ resources:
+ - events
+ verbs:
+ - create
+ - patch
+- apiGroups:
+ - ''
+ resources:
+ - pods
+ - services
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - apps
+ resources:
+ - statefulsets
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - dragonflydb.io
+ resources:
+ - dragonflies
+ verbs:
+ - create
+ - delete
+ - get
+ - list
+ - patch
+ - update
+ - watch
+- apiGroups:
+ - dragonflydb.io
+ resources:
+ - dragonflies/finalizers
+ verbs:
+ - update
+- apiGroups:
+ - dragonflydb.io
+ resources:
+ - dragonflies/status
+ verbs:
+ - get
+ - patch
+ - update
+
--- kubernetes/talos-flux/apps/database/dragonfly/operator Kustomization: flux-system/apps-dragonfly-operator ClusterRoleBinding: flux-system/dragonfly-operator
+++ kubernetes/talos-flux/apps/database/dragonfly/operator Kustomization: flux-system/apps-dragonfly-operator ClusterRoleBinding: flux-system/dragonfly-operator
@@ -0,0 +1,20 @@
+---
+apiVersion: rbac.authorization.k8s.io/v1
+kind: ClusterRoleBinding
+metadata:
+ labels:
+ app.kubernetes.io/component: dragonfly
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/name: dragonfly-operator
+ kustomize.toolkit.fluxcd.io/name: apps-dragonfly-operator
+ kustomize.toolkit.fluxcd.io/namespace: flux-system
+ name: dragonfly-operator
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: dragonfly-operator
+subjects:
+- kind: ServiceAccount
+ name: dragonfly-operator
+ namespace: database
+ |
--- HelmRelease: database/dragonfly-operator ServiceAccount: database/dragonfly-operator
+++ HelmRelease: database/dragonfly-operator ServiceAccount: database/dragonfly-operator
@@ -0,0 +1,12 @@
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: dragonfly-operator
+ labels:
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: dragonfly-operator
+secrets:
+- name: dragonfly-operator-sa-token
+
--- HelmRelease: database/dragonfly-operator Service: database/dragonfly-operator
+++ HelmRelease: database/dragonfly-operator Service: database/dragonfly-operator
@@ -0,0 +1,26 @@
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: dragonfly-operator
+ labels:
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: dragonfly-operator
+ app.kubernetes.io/service: dragonfly-operator
+spec:
+ type: ClusterIP
+ ports:
+ - port: 8081
+ targetPort: 8081
+ protocol: TCP
+ name: http
+ - port: 8080
+ targetPort: 8080
+ protocol: TCP
+ name: metrics
+ selector:
+ app.kubernetes.io/component: dragonfly-operator
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/name: dragonfly-operator
+
--- HelmRelease: database/dragonfly-operator Deployment: database/dragonfly-operator
+++ HelmRelease: database/dragonfly-operator Deployment: database/dragonfly-operator
@@ -0,0 +1,83 @@
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: dragonfly-operator
+ labels:
+ app.kubernetes.io/component: dragonfly-operator
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: dragonfly-operator
+spec:
+ revisionHistoryLimit: 3
+ replicas: 1
+ strategy:
+ type: RollingUpdate
+ selector:
+ matchLabels:
+ app.kubernetes.io/component: dragonfly-operator
+ app.kubernetes.io/name: dragonfly-operator
+ app.kubernetes.io/instance: dragonfly-operator
+ template:
+ metadata:
+ annotations:
+ checksum/secrets: 4141e6981f3b767e75a4e744858b9ff414dba5d0ef6afd761f7700061fb6e32e
+ labels:
+ app.kubernetes.io/component: dragonfly-operator
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/name: dragonfly-operator
+ spec:
+ enableServiceLinks: false
+ serviceAccountName: dragonfly-operator
+ automountServiceAccountToken: true
+ securityContext:
+ runAsGroup: 65534
+ runAsNonRoot: true
+ runAsUser: 65534
+ hostIPC: false
+ hostNetwork: false
+ hostPID: false
+ dnsPolicy: ClusterFirst
+ topologySpreadConstraints:
+ - labelSelector:
+ matchLabels:
+ app.kubernetes.io/name: dragonfly-operator
+ maxSkew: 1
+ topologyKey: kubernetes.io/hostname
+ whenUnsatisfiable: DoNotSchedule
+ containers:
+ - args:
+ - --health-probe-bind-address=:8081
+ - --metrics-bind-address=:8080
+ command:
+ - /manager
+ image: ghcr.io/dragonflydb/operator:v1.1.2@sha256:f0d76725950095ac65b36252e0042d339d1db9b181b1d068f4b6686ea93055e4
+ livenessProbe:
+ failureThreshold: 3
+ httpGet:
+ path: /healthz
+ port: 8081
+ initialDelaySeconds: 15
+ periodSeconds: 20
+ timeoutSeconds: 1
+ name: app
+ readinessProbe:
+ failureThreshold: 3
+ httpGet:
+ path: /readyz
+ port: 8081
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ timeoutSeconds: 1
+ resources:
+ limits:
+ memory: 128Mi
+ requests:
+ cpu: 10m
+ securityContext:
+ allowPrivilegeEscalation: false
+ capabilities:
+ drop:
+ - ALL
+ readOnlyRootFilesystem: true
+
--- HelmRelease: database/dragonfly-operator ServiceMonitor: database/dragonfly-operator
+++ HelmRelease: database/dragonfly-operator ServiceMonitor: database/dragonfly-operator
@@ -0,0 +1,26 @@
+---
+apiVersion: monitoring.coreos.com/v1
+kind: ServiceMonitor
+metadata:
+ name: dragonfly-operator
+ labels:
+ app.kubernetes.io/instance: dragonfly-operator
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: dragonfly-operator
+spec:
+ jobLabel: dragonfly-operator
+ namespaceSelector:
+ matchNames:
+ - database
+ selector:
+ matchLabels:
+ app.kubernetes.io/service: dragonfly-operator
+ app.kubernetes.io/name: dragonfly-operator
+ app.kubernetes.io/instance: dragonfly-operator
+ endpoints:
+ - interval: 1m
+ path: /metrics
+ port: metrics
+ scheme: http
+ scrapeTimeout: 10s
+ |
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports MegaLinter is graciously provided by OX Security |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
No description provided.